To explore different scenarios for furture installation projections of PV (or any technology), ReEDS output data can be useful in providing standard scenarios. ReEDS installation projections are used in this journal as input data to the PV ICE tool.
Current sections include:
Scenarios of Interest: the Ref.Mod, o 95-by-35.Adv, and o 95-by-35+Elec.Adv+DR ones
import PV_ICE
import numpy as np
import pandas as pd
import os,sys
import matplotlib.pyplot as plt
from IPython.display import display
plt.rcParams.update({'font.size': 22})
plt.rcParams['figure.figsize'] = (12, 8)
import os
from pathlib import Path
testfolder = str(Path().resolve().parent.parent.parent / 'PV_ICE' / 'TEMP' / 'Solar_Futures')
inputfolder = str(Path().resolve().parent.parent.parent / 'PV_ICE' / 'TEMP')
print ("Your simulation will be stored in %s" % testfolder)
Your simulation will be stored in C:\Users\hmirletz\Documents\GitHub\PV_ICE\PV_ICE\TEMP\Solar_Futures
if not os.path.exists(testfolder):
os.makedirs(testfolder)
PV_ICE.__version__
'v0.2.0+61.g5f5316e.dirty'
r"""
reedsFile = str(Path().resolve().parent.parent.parent.parent / 'December Core Scenarios ReEDS Outputs Solar Futures v2a.xlsx')
print ("Input file is stored in %s" % reedsFile)
rawdf = pd.read_excel(reedsFile,
sheet_name="UPV Capacity (GW)")
#index_col=[0,2,3]) #this casts scenario, PCA and State as levels
#now set year as an index in place
#rawdf.drop(columns=['State'], inplace=True)
rawdf.drop(columns=['Tech'], inplace=True)
rawdf.set_index(['Scenario','Year','PCA', 'State'], inplace=True)
""";
#scenarios = list(rawdf.index.get_level_values('Scenario').unique())
#PCAs = list(rawdf.index.get_level_values('PCA').unique())
#STATEs = list(rawdf.index.get_level_values('State').unique())
scenarios = ['Reference.Mod',
'Reference.Adv',
'Reference.Adv_DR',
'95-by-35.Mod',
'95-by-35.Adv',
'95-by-35.Adv_DR',
'95-by-35_Elec.Mod',
'95-by-35_Elec.Adv',
'95-by-35_Elec.Adv_DR']
#simulationname = scenarios
#simulationname = [w.replace('+', '_') for w in simulationname]
#simulationname
Scenarios of Interest:
#SFscenarios = [simulationname[0], simulationname[4], simulationname[8]]
SFscenarios = ['Reference.Mod', '95-by-35.Adv', '95-by-35_Elec.Adv_DR']
SFscenarios
['Reference.Mod', '95-by-35.Adv', '95-by-35_Elec.Adv_DR']
Keeping track of each scenario as its own PV ICE Object.
#for ii in range (0, 1): #len(scenarios):
i = 0
rr = PV_ICE.Simulation(name='USA', path=testfolder)
for i in range(0, 3):
filetitle = SFscenarios[i]+'.csv'
filetitle = os.path.join(inputfolder, 'USA', filetitle)
rr.createScenario(name=SFscenarios[i], file=filetitle)
rr.scenario[SFscenarios[i]].addMaterial('glass', file=r'..\..\baselines\SolarFutures_2021\baseline_material_glass_Reeds.csv')
rr.scenario[SFscenarios[i]].addMaterial('silicon', file=r'..\..\baselines\SolarFutures_2021\baseline_material_silicon_Reeds.csv')
rr.scenario[SFscenarios[i]].addMaterial('silver', file=r'..\..\baselines\SolarFutures_2021\baseline_material_silver_Reeds.csv')
rr.scenario[SFscenarios[i]].addMaterial('copper', file=r'..\..\baselines\SolarFutures_2021\baseline_material_copper_Reeds.csv')
rr.scenario[SFscenarios[i]].addMaterial('aluminum', file=r'..\..\baselines\SolarFutures_2021\baseline_material_aluminium_Reeds.csv')
path = C:\Users\hmirletz\Documents\GitHub\PV_ICE\PV_ICE\TEMP\Solar_Futures
IRENA= False
PERFECTMFG = True
mats = ['glass', 'silicon','silver','copper','aluminum']
ELorRL = 'EL'
if IRENA:
if ELorRL == 'RL':
weibullInputParams = {'alpha': 5.3759, 'beta':30} # Regular-loss scenario IRENA
if ELorRL == 'EL':
weibullInputParams = {'alpha': 2.49, 'beta':30} # Regular-loss scenario IRENA
if PERFECTMFG:
for jj in range (0, len(rr.scenario.keys())):
rr.scenario[list(rr.scenario.keys())[jj]].data['mod_lifetime'] = 40
rr.scenario[list(rr.scenario.keys())[jj]].data['mod_MFG_eff'] = 100.0
for kk in range(0, len(mats)):
mat = mats[kk]
rr.scenario[list(rr.scenario.keys())[jj]].material[mat].materialdata['mat_MFG_eff'] = 100.0
rr.scenario[list(rr.scenario.keys())[jj]].material[mat].materialdata['mat_MFG_scrap_Recycled'] = 0.0
rr.calculateMassFlow(weibullInputParams=weibullInputParams)
title_Method = 'Irena_'+ELorRL
else:
rr.calculateMassFlow()
title_Method = 'PVICE'
Working on Scenario: Reference.Mod ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silicon ==> Working on Material : silver ==> Working on Material : copper ==> Working on Material : aluminum Working on Scenario: 95-by-35.Adv ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silicon ==> Working on Material : silver ==> Working on Material : copper ==> Working on Material : aluminum Working on Scenario: 95-by-35_Elec.Adv_DR ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silicon ==> Working on Material : silver ==> Working on Material : copper ==> Working on Material : aluminum
print("Scenarios:", rr.scenario.keys())
print("Module Keys:", rr.scenario[SFscenarios[0]].data.keys())
print("Material Keys: ", rr.scenario[SFscenarios[0]].material['glass'].materialdata.keys())
Scenarios: dict_keys(['Reference.Mod', '95-by-35.Adv', '95-by-35_Elec.Adv_DR'])
Module Keys: Index(['year', 'new_Installed_Capacity_[MW]', 'mod_eff', 'mod_reliability_t50',
'mod_reliability_t90', 'mod_degradation', 'mod_lifetime', 'mod_MFG_eff',
'mod_EOL_collection_eff', 'mod_EOL_collected_recycled', 'mod_Repair',
'mod_MerchantTail', 'mod_Reuse', 'irradiance_stc', 'Area',
'Cumulative_Area_disposedby_Failure',
'Cumulative_Area_disposedby_ProjectLifetime',
'Cumulative_Area_disposed', 'Repaired_[W]', 'Repaired_Area',
'Cumulative_Active_Area', 'Installed_Capacity_[W]', 'WeibullParams',
'EOL_on_Year_0', 'EOL_on_Year_1', 'EOL_on_Year_2', 'EOL_on_Year_3',
'EOL_on_Year_4', 'EOL_on_Year_5', 'EOL_on_Year_6', 'EOL_on_Year_7',
'EOL_on_Year_8', 'EOL_on_Year_9', 'EOL_on_Year_10', 'EOL_on_Year_11',
'EOL_on_Year_12', 'EOL_on_Year_13', 'EOL_on_Year_14', 'EOL_on_Year_15',
'EOL_on_Year_16', 'EOL_on_Year_17', 'EOL_on_Year_18', 'EOL_on_Year_19',
'EOL_on_Year_20', 'EOL_on_Year_21', 'EOL_on_Year_22', 'EOL_on_Year_23',
'EOL_on_Year_24', 'EOL_on_Year_25', 'EOL_on_Year_26', 'EOL_on_Year_27',
'EOL_on_Year_28', 'EOL_on_Year_29', 'EOL_on_Year_30', 'EOL_on_Year_31',
'EOL_on_Year_32', 'EOL_on_Year_33', 'EOL_on_Year_34', 'EOL_on_Year_35',
'EOL_on_Year_36', 'EOL_on_Year_37', 'EOL_on_Year_38', 'EOL_on_Year_39',
'EOL_on_Year_40', 'EoL_Collected', 'EoL_NotCollected', 'EoL_Recycled',
'EoL_NotRecycled_Landfilled', 'ModuleTotal_MFG'],
dtype='object')
Material Keys: Index(['year', 'mat_virgin_eff', 'mat_massperm2', 'mat_MFG_eff',
'mat_MFG_scrap_Recycled', 'mat_MFG_scrap_Recycling_eff',
'mat_MFG_scrap_Recycled_into_HQ',
'mat_MFG_scrap_Recycled_into_HQ_Reused4MFG',
'mat_EOL_collected_Recycled', 'mat_EOL_Recycling_eff',
'mat_EOL_Recycled_into_HQ', 'mat_EOL_RecycledHQ_Reused4MFG',
'mat_modules_Collected', 'mat_modules_NotCollected',
'mat_modules_Recycled', 'mat_modules_NotRecycled',
'mat_EOL_sento_Recycling', 'mat_EOL_NotRecycled_Landfilled',
'mat_EOL_Recycled', 'mat_EOL_Recycled_Losses_Landfilled',
'mat_EOL_Recycled_2_HQ', 'mat_EOL_Recycled_2_OQ',
'mat_EoL_Recycled_HQ_into_MFG', 'mat_EOL_Recycled_HQ_into_OU',
'mat_UsedSuccessfullyinModuleManufacturing',
'mat_EnteringModuleManufacturing', 'mat_LostinModuleManufacturing',
'mat_Manufacturing_Input', 'mat_MFG_Scrap',
'mat_MFG_Scrap_Sentto_Recycling', 'mat_MFG_Scrap_Landfilled',
'mat_MFG_Scrap_Recycled_Successfully',
'mat_MFG_Scrap_Recycled_Losses_Landfilled', 'mat_MFG_Recycled_into_HQ',
'mat_MFG_Recycled_into_OQ', 'mat_MFG_Recycled_HQ_into_MFG',
'mat_MFG_Recycled_HQ_into_OU', 'mat_Virgin_Stock',
'mat_Virgin_Stock_Raw', 'mat_Total_EOL_Landfilled',
'mat_Total_MFG_Landfilled', 'mat_Total_Landfilled',
'mat_Total_Recycled_OU'],
dtype='object')
"""
r1.plotScenariosComparison(keyword='Cumulative_Area_disposedby_Failure')
r1.plotMaterialComparisonAcrossScenarios(material='silicon', keyword='mat_Total_Landfilled')
"""
pass
USyearly=pd.DataFrame()
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
keywd = 'mat_Virgin_Stock'
for jj in range(len(SFscenarios)):
obj = SFscenarios[jj]
for ii in range(len(materials)):
USyearly['VirginStock_'+materials[ii]+'_'+obj] = rr.scenario[obj].material[materials[ii]].materialdata[keywd]
filter_col = [col for col in USyearly if (col.startswith('VirginStock_') and col.endswith(obj))]
USyearly['VirginStock_Module_'+obj] = USyearly[filter_col].sum(axis=1)
keywd = 'mat_Total_Landfilled'
for jj in range(len(SFscenarios)):
obj = SFscenarios[jj]
for ii in range(len(materials)):
USyearly['Waste_'+materials[ii]+'_'+obj] = rr.scenario[obj].material[materials[ii]].materialdata[keywd]
filter_col = [col for col in USyearly if (col.startswith('Waste_') and col.endswith(obj)) ]
USyearly['Waste_Module_'+obj] = USyearly[filter_col].sum(axis=1)
keywd = 'mat_Total_EOL_Landfilled'
for jj in range(len(SFscenarios)):
obj = SFscenarios[jj]
for ii in range(len(materials)):
USyearly['Waste_EOL_'+materials[ii]+'_'+obj] = rr.scenario[obj].material[materials[ii]].materialdata[keywd]
filter_col = [col for col in USyearly if (col.startswith('Waste_EOL_') and col.endswith(obj)) ]
USyearly['Waste_EOL_Module_'+obj] = USyearly[filter_col].sum(axis=1)
keywd = 'mat_Total_MFG_Landfilled'
for jj in range(len(SFscenarios)):
obj = SFscenarios[jj]
for ii in range(len(materials)):
USyearly['Waste_MFG_'+materials[ii]+'_'+obj] = rr.scenario[obj].material[materials[ii]].materialdata[keywd]
filter_col = [col for col in USyearly if (col.startswith('Waste_MFG_') and col.endswith(obj)) ]
USyearly['Waste_MFG_Module_'+obj] = USyearly[filter_col].sum(axis=1)
USyearly = USyearly/1000000 # This is the ratio for Metric tonnes
#907185 -- this is for US tons
keyword='new_Installed_Capacity_[MW]'
for jj in range(len(SFscenarios)):
obj = SFscenarios[jj]
USyearly[keyword+obj] = rr.scenario[obj].data[keyword]
UScum = USyearly.copy()
UScum = UScum.cumsum()
keyword='Installed_Capacity_[W]'
for jj in range(len(SFscenarios)):
obj = SFscenarios[jj]
USyearly["Capacity_"+obj] = rr.scenario[obj].data[keyword]
USyearly.index = rr.scenario[obj].data['year']
UScum.index = rr.scenario[obj].data['year']
USyearly.head().iloc[1]
VirginStock_glass_Reference.Mod 1.442186e+05
VirginStock_silicon_Reference.Mod 1.445687e+04
VirginStock_silver_Reference.Mod 2.199155e+02
VirginStock_copper_Reference.Mod 1.022991e+02
VirginStock_aluminum_Reference.Mod 3.402000e+04
...
new_Installed_Capacity_[MW]95-by-35.Adv 2.534300e+03
new_Installed_Capacity_[MW]95-by-35_Elec.Adv_DR 2.534300e+03
Capacity_Reference.Mod 3.731350e+09
Capacity_95-by-35.Adv 3.731350e+09
Capacity_95-by-35_Elec.Adv_DR 3.731350e+09
Name: 2011, Length: 78, dtype: float64
USyearly.head()
| VirginStock_glass_Reference.Mod | VirginStock_silicon_Reference.Mod | VirginStock_silver_Reference.Mod | VirginStock_copper_Reference.Mod | VirginStock_aluminum_Reference.Mod | VirginStock_Module_Reference.Mod | VirginStock_glass_95-by-35.Adv | VirginStock_silicon_95-by-35.Adv | VirginStock_silver_95-by-35.Adv | VirginStock_copper_95-by-35.Adv | ... | Waste_MFG_silver_95-by-35_Elec.Adv_DR | Waste_MFG_copper_95-by-35_Elec.Adv_DR | Waste_MFG_aluminum_95-by-35_Elec.Adv_DR | Waste_MFG_Module_95-by-35_Elec.Adv_DR | new_Installed_Capacity_[MW]Reference.Mod | new_Installed_Capacity_[MW]95-by-35.Adv | new_Installed_Capacity_[MW]95-by-35_Elec.Adv_DR | Capacity_Reference.Mod | Capacity_95-by-35.Adv | Capacity_95-by-35_Elec.Adv_DR | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| year | |||||||||||||||||||||
| 2010 | 70184.285787 | 7082.020411 | 128.426774 | 49.784053 | 16728.966195 | 94173.483221 | 70184.285787 | 7082.020411 | 128.426774 | 49.784053 | ... | 27.740183 | 5.874518 | 498.523193 | 9032.812399 | 1200.651350 | 1200.651350 | 1200.651350 | 1.200651e+09 | 1.200651e+09 | 1.200651e+09 |
| 2011 | 144218.641713 | 14456.874009 | 219.915502 | 102.299090 | 34020.002590 | 193017.732904 | 144218.641713 | 14456.874009 | 219.915502 | 102.299090 | ... | 47.501748 | 12.071293 | 1013.796077 | 18445.373832 | 2534.300109 | 2534.300109 | 2534.300109 | 3.731350e+09 | 3.731350e+09 | 3.731350e+09 |
| 2012 | 142823.279530 | 14473.896289 | 172.505147 | 100.306250 | 33296.094628 | 190866.081844 | 142823.279530 | 14473.896289 | 172.505147 | 100.306250 | ... | 37.261112 | 11.836138 | 992.223620 | 18471.131942 | 2534.300109 | 2534.300109 | 2534.300109 | 6.254456e+09 | 6.254456e+09 | 6.254456e+09 |
| 2013 | 280638.797333 | 27437.479671 | 234.947057 | 195.163190 | 53446.058911 | 361952.446162 | 280638.720044 | 27437.472114 | 234.946992 | 195.163136 | ... | 50.748550 | 23.029250 | 1592.692117 | 35045.028655 | 5123.033732 | 5123.032321 | 5123.032321 | 1.135873e+10 | 1.135872e+10 | 1.135872e+10 |
| 2014 | 279365.351489 | 26818.242077 | 214.149815 | 191.571229 | 51596.845772 | 358186.160382 | 279365.274550 | 26818.234691 | 214.149756 | 191.571176 | ... | 46.256347 | 22.605399 | 1537.585581 | 33977.393769 | 5123.033732 | 5123.032321 | 5123.032321 | 1.644768e+10 | 1.644767e+10 | 1.644767e+10 |
5 rows × 78 columns
UScum.head()
| VirginStock_glass_Reference.Mod | VirginStock_silicon_Reference.Mod | VirginStock_silver_Reference.Mod | VirginStock_copper_Reference.Mod | VirginStock_aluminum_Reference.Mod | VirginStock_Module_Reference.Mod | VirginStock_glass_95-by-35.Adv | VirginStock_silicon_95-by-35.Adv | VirginStock_silver_95-by-35.Adv | VirginStock_copper_95-by-35.Adv | ... | Waste_MFG_Module_95-by-35.Adv | Waste_MFG_glass_95-by-35_Elec.Adv_DR | Waste_MFG_silicon_95-by-35_Elec.Adv_DR | Waste_MFG_silver_95-by-35_Elec.Adv_DR | Waste_MFG_copper_95-by-35_Elec.Adv_DR | Waste_MFG_aluminum_95-by-35_Elec.Adv_DR | Waste_MFG_Module_95-by-35_Elec.Adv_DR | new_Installed_Capacity_[MW]Reference.Mod | new_Installed_Capacity_[MW]95-by-35.Adv | new_Installed_Capacity_[MW]95-by-35_Elec.Adv_DR | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| year | |||||||||||||||||||||
| 2010 | 70184.285787 | 7082.020411 | 128.426774 | 49.784053 | 16728.966195 | 9.417348e+04 | 70184.285787 | 7082.020411 | 128.426774 | 49.784053 | ... | 9032.812399 | 4842.715719 | 3657.958785 | 27.740183 | 5.874518 | 498.523193 | 9032.812399 | 1200.651350 | 1200.651350 | 1200.651350 |
| 2011 | 214402.927500 | 21538.894420 | 348.342276 | 152.083143 | 50748.968785 | 2.871912e+05 | 214402.927500 | 21538.894420 | 348.342276 | 152.083143 | ... | 27478.186231 | 14793.801998 | 11078.877221 | 75.241932 | 17.945811 | 1512.319270 | 27478.186231 | 3734.951459 | 3734.951459 | 3734.951459 |
| 2012 | 357226.207030 | 36012.790709 | 520.847423 | 252.389394 | 84045.063413 | 4.780573e+05 | 357226.207030 | 36012.790709 | 520.847423 | 252.389394 | ... | 45949.318172 | 24648.608285 | 18653.882006 | 112.503043 | 29.781948 | 2504.542890 | 45949.318172 | 6269.251568 | 6269.251568 | 6269.251568 |
| 2013 | 637865.004364 | 63450.270380 | 755.794480 | 447.552583 | 137491.122324 | 8.400097e+05 | 637864.927074 | 63450.262823 | 755.794415 | 447.552530 | ... | 80994.346827 | 44012.679968 | 32668.369060 | 163.251594 | 52.811199 | 4097.235007 | 80994.346827 | 11392.285299 | 11392.283888 | 11392.283888 |
| 2014 | 917230.355853 | 90268.512456 | 969.944295 | 639.123813 | 189087.968095 | 1.198196e+06 | 917230.201624 | 90268.497514 | 969.944172 | 639.123706 | ... | 114971.740596 | 62741.327974 | 46310.667497 | 209.507941 | 75.416597 | 5634.820587 | 114971.740596 | 16515.319031 | 16515.316209 | 16515.316209 |
5 rows × 75 columns
# Data for Jarett
USyearly.to_csv(title_Method+' US_Yearly NATION_tonnes.csv')
UScum.to_csv(title_Method+' US_Cumulative NATION_tonnes.csv')
USyearly3sig = USyearly.copy()
UScum3sig = UScum.copy()
N = 2
UScum3sig = UScum3sig.drop(UScum3sig.index[0])
USyearly3sig = USyearly3sig.drop(USyearly3sig.index[0])
if IRENA:
UScum3sig = UScum3sig.loc[:, ~UScum3sig.columns.str.startswith('Waste_MFG_')]
USyearly3sig = USyearly3sig.loc[:, ~USyearly3sig.columns.str.startswith('Waste_MFG_')]
USyearly3sig = USyearly3sig.applymap(lambda x: round(x, N - int(np.floor(np.log10(abs(x))))))
USyearly3sig = USyearly3sig.applymap(lambda x: int(x))
UScum3sig = UScum3sig.applymap(lambda x: round(x, N - int(np.floor(np.log10(abs(x))))))
UScum3sig = UScum3sig.applymap(lambda x: int(x))
USyearly3sig.to_csv(title_Method+' US_Yearly NATION_3sigs.csv')
UScum3sig.to_csv(title_Method+' US_Cumulative NATION_3sigs.csv')
print("Sanity check: mat_Total_Landfilled = mat_Total_EOL_Landfilled + mat_Total_MFG_Landfilled")
A = rr.scenario[obj].material[materials[ii]].materialdata['mat_Total_Landfilled'].iloc[5]
B = rr.scenario[obj].material[materials[ii]].materialdata['mat_Total_EOL_Landfilled'].iloc[5]
C = rr.scenario[obj].material[materials[ii]].materialdata['mat_Total_MFG_Landfilled'].iloc[5]
A - B - C
Sanity check: mat_Total_Landfilled = mat_Total_EOL_Landfilled + mat_Total_MFG_Landfilled
0.0
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='VirginStock_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
foo = pd.DataFrame()
# Loop over Keywords
ii = 0
# Loop over SF Scenarios
# loop plotting over scenarios
# SCENARIO 1 ***************
kk = 0
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'k.', linewidth=5, label='S1 Reference Scenario: module mass')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'k', linewidth=5, label='S1 Reference Scenario: glass mass only')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
kk = 1
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'g.', linewidth=5, label='S2 Grid Decarbonization: module mass')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'g', linewidth=5, label='S2 Grid Decarbonization: glass mass only')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 3 ***************
kk = 2
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'c.', linewidth=5, label='S3 High Electrification: module mass')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'c', linewidth=5, label='S3 High Electrification: glass mass only')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Virgin Material Needs by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
for kk in range (0, 3):
obj = SFscenarios[kk]
matcum.append(UScum[keyw+materials[ii]+'_'+obj].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminum']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(3)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminum'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Virgin Material Cumulative Needs 2020-2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
#a1.set_xticks(ind, ('S1', 'S2', 'S3'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'Aluminum', 'Silicon','Copper','Silver'))
f.tight_layout()
f.savefig(title_Method+' Fig_2x1_Yearly Virgin Material Needs by Scenario and Cumulatives.png', dpi=600)
plt.show()
rr.scenario['Reference.Mod'].material['glass'].materialdata['mat_Virgin_Stock'].tail(5)
36 1.021035e+12 37 1.605191e+12 38 1.601007e+12 39 1.115273e+12 40 1.112549e+12 Name: mat_Virgin_Stock, dtype: float64
# SOLAR FUTURES FIGURE 3
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='VirginStock_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over Keywords
ii = 0
# Loop over SF Scenarios
# loop plotting over scenarios
# SCENARIO 1 ***************
kk = 0
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'k.', linewidth=5, label='Reference: module ')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'k', linewidth=5, label='Reference: glass ')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
kk = 1
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'g.', linewidth=5, label='Decarb.: module ')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'g', linewidth=5, label='Decarb.: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 3 ***************
kk = 2
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'c.', linewidth=5, label='Decarb+E: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'c', linewidth=5, label='Decarb+E: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend(loc='upper left')
a0.set_title('Yearly Virgin Material Needs by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlabel('Years')
#a0.tick_params(axis='y', which='minor', length=3)
#a0.set_yticks(minorbool=True)
a0.minorticks_on()
a0.tick_params(axis='y', which='minor', bottom=False)
########################
# SUBPLOT 2
########################
#######################
# Calculate
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
for kk in range (0, 3):
obj = SFscenarios[kk]
matcum.append(UScum[keyw+materials[ii]+'_'+obj].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminum']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(3)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminum'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Virgin Material Cumulative Needs 2020-2050 [Million Tonnes]')
#a1.set_xlabel('Scenario')
a1.tick_params(axis='y', which='minor', bottom='off')
#a1.minorticks_on()
plt.sca(a1)
plt.xticks(range(3), ['Ref.', 'Decarb.', 'Decarb+E.'], color='black', rotation=0)
plt.tick_params(axis='y', which='minor', bottom=False)
#plt.yticks(minor=True)
a1.legend((p4[0], p3[0], p2[0], p1[0], p0[0] ), ('Silver', 'Copper', 'Silicon','Aluminum','Glass'))
f.tight_layout()
f.savefig(title_Method+' SF Figure 3 - Yearly Virgin Material Needs by Scenario and Cumulatives.png', dpi=600)
plt.show()
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over Keywords
ii = 0
# Loop over SF Scenarios
# loop plotting over scenarios
# SCENARIO 1 ***************
kk = 0
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'k.', linewidth=5, label='Reference: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'k', linewidth=5, label='Reference: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
kk = 1
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'g.', linewidth=5, label='Decarb.: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'g', linewidth=5, label='Decarb.: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 3 ***************
kk = 2
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'c.', linewidth=5, label='Decarb+E: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'c', linewidth=5, label='Decarb+E: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Manufacturing Scrap and EoL Material by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlabel('Years')
a0.minorticks_on()
a0.tick_params(axis='y', which='minor', bottom=False)
########################
# SUBPLOT 2
########################
#######################
# Calculate
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
for kk in range (0, 3):
obj = SFscenarios[kk]
matcum.append(UScum[keyw+materials[ii]+'_'+obj].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminum']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(3)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminum'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative Manufacturing Scrap and EoL Material \n by 2050 [Million Tonnes]')
plt.sca(a1)
plt.xticks(range(3), ['Ref.', 'Decarb.', 'Decarb+E'], color='black', rotation=0)
plt.tick_params(axis='y', which='minor', bottom=False)
#plt.yticks(minor=True)
a1.legend((p4[0], p3[0], p2[0], p1[0], p0[0] ), ('Silver', 'Copper', 'Silicon','Aluminum','Glass'))
f.tight_layout()
f.savefig(title_Method+' Fig_2x1_Yearly MFG and EOL Material by Scenario and Cumulatives_Nation.png', dpi=600)
plt.show()
# SOLAR FUTURES FIGURE 17
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_EOL_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over Keywords
ii = 0
# Loop over SF Scenarios
# loop plotting over scenarios
# SCENARIO 1 ***************
kk = 0
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'k.', linewidth=5, label='Reference: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'k', linewidth=5, label='Reference: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
kk = 1
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'g.', linewidth=5, label='Decarb.: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'g', linewidth=5, label='Decarb.: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 3 ***************
kk = 2
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'c.', linewidth=5, label='Decarb+E: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'c', linewidth=5, label='Decarb+E: glass ')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly End of Life Material by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlabel('Years')
a0.minorticks_on()
a0.tick_params(axis='y', which='minor', bottom=False)
########################
# SUBPLOT 2
########################
#######################
# Calculate
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
for kk in range (0, 3):
obj = SFscenarios[kk]
matcum.append(UScum[keyw+materials[ii]+'_'+obj].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminum']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(3)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminum'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative End of Life Material by 2050 [Million Tonnes]')
plt.sca(a1)
plt.xticks(range(3), ['Ref.', 'Decarb.', 'Decarb+E'], color='black', rotation=0)
plt.tick_params(axis='y', which='minor', bottom=False)
#plt.yticks(minor=True)
a1.legend((p4[0], p3[0], p2[0], p1[0], p0[0] ), ('Silver', 'Copper', 'Silicon','Aluminum','Glass'))
f.tight_layout()
f.savefig(title_Method+' SF Figure 17 - Yearly EoL Waste by Scenario and Cumulatives_Nation.png', dpi=600)
plt.show()
### SOLAR FUTURES FIGURE 18
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_MFG_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over Keywords
ii = 0
# Loop over SF Scenarios
# loop plotting over scenarios
# SCENARIO 1 ***************
kk = 0
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'k.', linewidth=5, label='Reference: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'k', linewidth=5, label='Reference: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
kk = 1
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'g.', linewidth=5, label='Decarb.: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'g', linewidth=5, label='Decarb.: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 3 ***************
kk = 2
obj = SFscenarios[kk]
modulemat = (USyearly[keyw+materials[0]+'_'+obj]+USyearly[keyw+materials[1]+'_'+obj]+
USyearly[keyw+materials[2]+'_'+obj]+USyearly[keyw+materials[3]+'_'+obj]+
USyearly[keyw+materials[4]+'_'+obj])
glassmat = (USyearly[keyw+materials[0]+'_'+obj])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(rr.scenario[obj].data['year'], modulemat, 'c.', linewidth=5, label='Decarb+E: module')
a0.plot(rr.scenario[obj].data['year'], glassmat, 'c', linewidth=5, label='Decarb+E: glass')
a0.fill_between(rr.scenario[obj].data['year'], glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend(loc='upper left')
a0.set_title('Yearly Manufacturing Scrap by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlabel('Years')
a0.minorticks_on()
a0.tick_params(axis='y', which='minor', bottom=False)
########################
# SUBPLOT 2
########################
#######################
# Calculate
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
for kk in range (0, 3):
obj = SFscenarios[kk]
matcum.append(UScum[keyw+materials[ii]+'_'+obj].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminum']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(3)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminum'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative Manufacturing Scrap by 2050 [Million Tonnes]')
plt.sca(a1)
plt.xticks(range(3), ['Ref.', 'Decarb.', 'Decarb+E'], color='black', rotation=0)
plt.tick_params(axis='y', which='minor', bottom=False)
#plt.yticks(minor=True)
a1.legend((p4[0], p3[0], p2[0], p1[0], p0[0] ), ('Silver', 'Copper', 'Silicon','Aluminum','Glass'))
f.tight_layout()
f.savefig(title_Method+' SF Figure 18 - Yearly MFG Waste by Scenario and Cumulatives_Nation.png', dpi=600)
plt.show()
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (8, 8)
fig, axs = plt.subplots(figsize=(8, 8))
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6-UScum['new_Installed_Capacity_[MW]'+SFscenarios[1]]/1e6, 'k', label='Cumulative New Yearly Installs S3-S2')
#axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6, 'c', label='Cumulative New Yearly Installs')
axs.legend()
axs.set_xlim([2020,2030])
axs.set_ylabel('Power [TW]')
fig.savefig(title_Method+' Fig_New_Installs_vs_InstalledCapacity_vs_Waste', dpi=600)
plt.show()
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (8, 8)
fig, axs = plt.subplots(figsize=(8, 8))
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6, 'b', label='Cumulative New Yearly Installs')
axs.plot(USyearly['Capacity_'+SFscenarios[0]]/1e12, 'g', label='Active in Field Installs')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6-USyearly['Capacity_'+SFscenarios[0]]/1e12, 'r', label='Decomissioned PV Panels')
axs.legend()
axs.set_xlim([2020,2050])
axs.set_ylabel('Power [TW]')
fig.savefig(title_Method+' Fig_New_Installs_vs_InstalledCapacity_vs_Waste', dpi=600)
plt.show()
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (8, 8)
fig, axs = plt.subplots(figsize=(8, 8))
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6, 'b', label='Cumulative New Yearly Installs Scen. 1 ')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[1]]/1e6, 'b--', label='Cumulative New Yearly Installs Scen. 2 ')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6, 'b.', label='Cumulative New Yearly Installs Scen. 3 ')
axs.plot(USyearly['Capacity_'+SFscenarios[0]]/1e12, 'g', label='Active in Field Installs Scen. 1')
axs.plot(USyearly['Capacity_'+SFscenarios[1]]/1e12, 'g--', label='Active in Field Installs Scen. 2')
axs.plot(USyearly['Capacity_'+SFscenarios[2]]/1e12, 'g.', label='Active in Field Installs Scen. 3')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6-USyearly['Capacity_'+SFscenarios[0]]/1e12, 'r', label='Decomissioned PV Panels Scen. 1')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[1]]/1e6-USyearly['Capacity_'+SFscenarios[1]]/1e12, 'r--', label='Decomissioned PV Panels Scen 2')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6-USyearly['Capacity_'+SFscenarios[2]]/1e12, 'r.', label='Decomissioned PV Panels Scen 3')
axs.legend()
axs.set_xlim([2020,2050])
axs.set_ylabel('Power [TW]')
plt.show()
foo0 = (UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6-USyearly['Capacity_'+SFscenarios[0]]/1e12).sum()
foo1 = (UScum['new_Installed_Capacity_[MW]'+SFscenarios[1]]/1e6-USyearly['Capacity_'+SFscenarios[1]]/1e12).sum()
foo2 = (UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6-USyearly['Capacity_'+SFscenarios[2]]/1e12).sum()
print(foo0, foo1, foo2)
1.4212136468803815 1.9130461513960169 2.1940022492546776
E = (UScum['new_Installed_Capacity_[MW]Reference.Mod']/1e6).sum()
F = (UScum['new_Installed_Capacity_[MW]Reference.Mod']/1e6-USyearly['Capacity_Reference.Mod']/1e12).sum()
print("Cumulative Installs", E)
print("Cumulative Waste", F)
print("Fraction of Decomisioned to Installed Cumulative by 2050", F/E)
Cumulative Installs 12.481579419861927 Cumulative Waste 1.4212136468803815 Fraction of Decomisioned to Installed Cumulative by 2050 0.11386488833446876
SFscenarios[1]
'95-by-35.Adv'
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (8, 8)
fig, axs = plt.subplots(figsize=(8, 8))
axs.plot(USyearly['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6, 'b', label='Yearly New Yearly Installs')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6-USyearly['Capacity_'+SFscenarios[0]]/1e12, 'r', label='Decomissioned PV Panels')
axs.legend()
axs.set_xlim([2020,2050])
axs.set_ylabel('Power [TW]')
fig.savefig(title_Method+' Fig_New_Installs_vs_Decomisions', dpi=600)
plt.show()
### SOLAR FUTURES FIGURE 20
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (8, 8)
fig, axs = plt.subplots(figsize=(8, 8))
axs.plot(USyearly['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6, 'b', label='Reference: New Installs')
#axs.plot(USyearly['new_Installed_Capacity_[MW]'+SFscenarios[1]]/1e6, 'b', label='Grid Decarb.: Yearly New Yearly Installs')
axs.plot(USyearly['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6, 'b--', label='Decarb+E: New Installs')
axs.fill_between(rr.scenario[obj].data['year'], USyearly['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6,
USyearly['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6, color='b', alpha=0.3,
interpolate=True)
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6-USyearly['Capacity_'+SFscenarios[0]]/1e12, 'r', label='Reference: Decomissioned PV Panels')
axs.plot(UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6-USyearly['Capacity_'+SFscenarios[2]]/1e12, 'r--', label='Decarb+E: Decomissioned PV Panels')
axs.fill_between(rr.scenario[obj].data['year'], UScum['new_Installed_Capacity_[MW]'+SFscenarios[0]]/1e6-USyearly['Capacity_'+SFscenarios[0]]/1e12,
UScum['new_Installed_Capacity_[MW]'+SFscenarios[2]]/1e6-USyearly['Capacity_'+SFscenarios[2]]/1e12, color='r', alpha=0.3,
interpolate=True)
axs.minorticks_on()
axs.legend()
axs.set_xlim([2020,2050])
axs.set_ylabel('Power [TW]')
fig.savefig(title_Method+' SF Figure 20 - New Installs vs Decomisions', dpi=600)
plt.show()
print("CUMULATIVE WASTE by 2050")
print("*************************")
print("")
UScum.iloc[-1]
print("MFG Scrap + EoL Material Only")
print("\t Reference Scenario: ", UScum['Waste_Module_Reference.Mod'].iloc[-1]/1e6, ' Million Tonnes')
print("\t Grid Decarbonization Scenario: ", UScum['Waste_Module_95-by-35.Adv'].iloc[-1]/1e6, ' Million Tonnes')
print("\t High Electrification Scenario: ", UScum['Waste_Module_95-by-35_Elec.Adv_DR'].iloc[-1]/1e6, ' Million Tonnes')
print("EoL Material Only")
print("\t Reference Scenario: ", UScum['Waste_EOL_Module_Reference.Mod'].iloc[-1]/1e6, ' Million Tonnes')
print("\t Grid Decarbonization Scenario: ", UScum['Waste_EOL_Module_95-by-35.Adv'].iloc[-1]/1e6, ' Million Tonnes')
print("\t High Electrification Scenario: ", UScum['Waste_EOL_Module_95-by-35_Elec.Adv_DR'].iloc[-1]/1e6, ' Million Tonnes')
print("MFG Scrap Only")
print("\t Reference Scenario: ", UScum['Waste_MFG_Module_Reference.Mod'].iloc[-1]/1e6, ' Million Tonnes')
print("\t Grid Decarbonization Scenario: ", UScum['Waste_MFG_Module_95-by-35.Adv'].iloc[-1]/1e6, ' Million Tonnes')
print("\t High Electrification Scenario: ", UScum['Waste_MFG_Module_95-by-35_Elec.Adv_DR'].iloc[-1]/1e6, ' Million Tonnes')
plt.show()
CUMULATIVE WASTE by 2050 ************************* MFG Scrap + EoL Material Only Reference Scenario: 7.598873807149782 Million Tonnes Grid Decarbonization Scenario: 9.720686125963702 Million Tonnes High Electrification Scenario: 10.839108143474517 Million Tonnes EoL Material Only Reference Scenario: 5.768846179490254 Million Tonnes Grid Decarbonization Scenario: 7.081040756363472 Million Tonnes High Electrification Scenario: 7.05823473941935 Million Tonnes MFG Scrap Only Reference Scenario: 1.8300276276595273 Million Tonnes Grid Decarbonization Scenario: 2.63964536960023 Million Tonnes High Electrification Scenario: 3.780873404055167 Million Tonnes
print(" VIRGIN STOCK Yearly Needs ")
print(" **************************")
for kk in range(0, 3):
obj = SFscenarios[kk]
print(obj)
filter_col = [col for col in USyearly3sig if (col.startswith('VirginStock_') and col.endswith(obj)) ]
display(USyearly3sig[filter_col].loc[[2030, 2040, 2050]])
print("\n\n")
print(" VIRGIN STOCK Cumulative Needs ")
print(" ***************************** ")
for kk in range(0, 3):
obj = SFscenarios[kk]
print(obj)
filter_col = [col for col in UScum3sig if (col.startswith('VirginStock_') and col.endswith(obj)) ]
display(UScum3sig[filter_col].loc[[2030, 2040, 2050]])
print("\n\n")
VIRGIN STOCK Yearly Needs ************************** Reference.Mod
| VirginStock_glass_Reference.Mod | VirginStock_silicon_Reference.Mod | VirginStock_silver_Reference.Mod | VirginStock_copper_Reference.Mod | VirginStock_aluminum_Reference.Mod | VirginStock_Module_Reference.Mod | |
|---|---|---|---|---|---|---|
| year | ||||||
| 2030 | 1810000 | 85700 | 453 | 1480 | 206000 | 2100000 |
| 2040 | 799000 | 37900 | 200 | 657 | 91100 | 929000 |
| 2050 | 1110000 | 52800 | 279 | 915 | 127000 | 1290000 |
95-by-35.Adv
| VirginStock_glass_95-by-35.Adv | VirginStock_silicon_95-by-35.Adv | VirginStock_silver_95-by-35.Adv | VirginStock_copper_95-by-35.Adv | VirginStock_aluminum_95-by-35.Adv | VirginStock_Module_95-by-35.Adv | |
|---|---|---|---|---|---|---|
| year | ||||||
| 2030 | 2320000 | 110000 | 582 | 1910 | 264000 | 2700000 |
| 2040 | 322000 | 15300 | 80 | 265 | 36700 | 375000 |
| 2050 | 1250000 | 59300 | 313 | 1030 | 142000 | 1450000 |
95-by-35_Elec.Adv_DR
| VirginStock_glass_95-by-35_Elec.Adv_DR | VirginStock_silicon_95-by-35_Elec.Adv_DR | VirginStock_silver_95-by-35_Elec.Adv_DR | VirginStock_copper_95-by-35_Elec.Adv_DR | VirginStock_aluminum_95-by-35_Elec.Adv_DR | VirginStock_Module_95-by-35_Elec.Adv_DR | |
|---|---|---|---|---|---|---|
| year | ||||||
| 2030 | 3300000 | 157000 | 828 | 2710 | 376000 | 3840000 |
| 2040 | 528000 | 25000 | 132 | 434 | 60100 | 613000 |
| 2050 | 2640000 | 125000 | 661 | 2170 | 300000 | 3060000 |
VIRGIN STOCK Cumulative Needs ***************************** Reference.Mod
| VirginStock_glass_Reference.Mod | VirginStock_silicon_Reference.Mod | VirginStock_silver_Reference.Mod | VirginStock_copper_Reference.Mod | VirginStock_aluminum_Reference.Mod | VirginStock_Module_Reference.Mod | |
|---|---|---|---|---|---|---|
| year | ||||||
| 2030 | 14100000 | 847000 | 5970 | 12700 | 1920000 | 16800000 |
| 2040 | 20200000 | 1140000 | 7520 | 17800 | 2620000 | 24000000 |
| 2050 | 31800000 | 1690000 | 10400 | 27300 | 3940000 | 37500000 |
95-by-35.Adv
| VirginStock_glass_95-by-35.Adv | VirginStock_silicon_95-by-35.Adv | VirginStock_silver_95-by-35.Adv | VirginStock_copper_95-by-35.Adv | VirginStock_aluminum_95-by-35.Adv | VirginStock_Module_95-by-35.Adv | |
|---|---|---|---|---|---|---|
| year | ||||||
| 2030 | 21500000 | 1240000 | 8450 | 19900 | 2850000 | 25600000 |
| 2040 | 36800000 | 1960000 | 12300 | 32500 | 4590000 | 43400000 |
| 2050 | 46900000 | 2440000 | 14800 | 40800 | 5740000 | 55100000 |
95-by-35_Elec.Adv_DR
| VirginStock_glass_95-by-35_Elec.Adv_DR | VirginStock_silicon_95-by-35_Elec.Adv_DR | VirginStock_silver_95-by-35_Elec.Adv_DR | VirginStock_copper_95-by-35_Elec.Adv_DR | VirginStock_aluminum_95-by-35_Elec.Adv_DR | VirginStock_Module_95-by-35_Elec.Adv_DR | |
|---|---|---|---|---|---|---|
| year | ||||||
| 2030 | 25500000 | 1430000 | 9570 | 23400 | 3320000 | 30300000 |
| 2040 | 50300000 | 2610000 | 15800 | 43800 | 6150000 | 59100000 |
| 2050 | 70600000 | 3570000 | 20900 | 60500 | 8460000 | 82700000 |
print(" WASTE EoL CUMULATIVE RESULTS [Tonnes] ")
print(" ******************************************")
filter_col = [col for col in UScum3sig if (col.startswith('Waste_EOL_Module')) ]
display(UScum3sig[filter_col].loc[[2016,2020,2030, 2040, 2050]])
WASTE EoL CUMULATIVE RESULTS [Tonnes] ******************************************
| Waste_EOL_Module_Reference.Mod | Waste_EOL_Module_95-by-35.Adv | Waste_EOL_Module_95-by-35_Elec.Adv_DR | |
|---|---|---|---|
| year | |||
| 2016 | 11 | 11 | 11 |
| 2020 | 643 | 643 | 643 |
| 2030 | 165000 | 165000 | 165000 |
| 2040 | 2370000 | 2380000 | 2380000 |
| 2050 | 5770000 | 7080000 | 7060000 |
print(" WASTE EoL + MfgScrap CUMULATIVE RESULTS [Tonnes] ")
print(" ******************************************")
filter_col = [col for col in UScum3sig if (col.startswith('Waste_Module')) ]
display(UScum3sig[filter_col].loc[[2016,2020,2030, 2040, 2050]])
WASTE EoL + MfgScrap CUMULATIVE RESULTS [Tonnes] ******************************************
| Waste_Module_Reference.Mod | Waste_Module_95-by-35.Adv | Waste_Module_95-by-35_Elec.Adv_DR | |
|---|---|---|---|
| year | |||
| 2016 | 225000 | 225000 | 225000 |
| 2020 | 442000 | 440000 | 442000 |
| 2030 | 1150000 | 1600000 | 1810000 |
| 2040 | 3650000 | 4540000 | 5200000 |
| 2050 | 7600000 | 9720000 | 10800000 |
print(" WASTE MfgScrap CUMULATIVE RESULTS [Tonnes] ")
print(" ******************************************")
filter_col = [col for col in UScum3sig if (col.startswith('Waste_MFG_Module')) ]
display(UScum3sig[filter_col].loc[[2016,2020,2030, 2040, 2050]])
WASTE MfgScrap CUMULATIVE RESULTS [Tonnes] ******************************************
| Waste_MFG_Module_Reference.Mod | Waste_MFG_Module_95-by-35.Adv | Waste_MFG_Module_95-by-35_Elec.Adv_DR | |
|---|---|---|---|
| year | |||
| 2016 | 225000 | 225000 | 225000 |
| 2020 | 441000 | 440000 | 442000 |
| 2030 | 987000 | 1430000 | 1640000 |
| 2040 | 1280000 | 2160000 | 2820000 |
| 2050 | 1830000 | 2640000 | 3780000 |
materials = ['Module', 'glass', 'aluminum', 'copper', 'silicon', 'silver']
print(" Appendix Table I: Metric Tonnes Installed in field in 2030")
print(" ########################################################### \n")
#Loop over scenarios
for kk in range (0, 3):
obj = SFscenarios[kk]
print("SCENARIO :", obj)
print("********************************")
print("********************************")
modulemat = 0
for ii in range(0, len(materials)):
installedmat = (UScum3sig['VirginStock_'+materials[ii]+'_'+obj].loc[2030]-
UScum3sig['Waste_'+materials[ii]+'_'+obj].loc[2030])
print(materials[ii], ':', round(installedmat/1000)*1000, 'tons')
print("Capacity in Year 2030 [GW]:", round(USyearly3sig['Capacity_'+obj].loc[2030]/1e9))
print("Capacity in Year 2050 [GW]:", round(USyearly3sig['Capacity_'+obj].loc[2050]/1e9))
print("****************************\n")
Appendix Table I: Metric Tonnes Installed in field in 2030 ########################################################### SCENARIO : Reference.Mod ******************************** ******************************** Module : 15650000 tons glass : 13355000 tons aluminum : 1834000 tons copper : 11000 tons silicon : 530000 tons silver : 5000 tons Capacity in Year 2030 [GW]: 313 Capacity in Year 2050 [GW]: 639 **************************** SCENARIO : 95-by-35.Adv ******************************** ******************************** Module : 24000000 tons glass : 20460000 tons aluminum : 2736000 tons copper : 17000 tons silicon : 799000 tons silver : 6000 tons Capacity in Year 2030 [GW]: 487 Capacity in Year 2050 [GW]: 947 **************************** SCENARIO : 95-by-35_Elec.Adv_DR ******************************** ******************************** Module : 28490000 tons glass : 24330000 tons aluminum : 3192000 tons copper : 21000 tons silicon : 929000 tons silver : 7000 tons Capacity in Year 2030 [GW]: 585 Capacity in Year 2050 [GW]: 1520 ****************************
mining2020_aluminum = 65267000
mining2020_silver = 22260
mining2020_copper = 20000000
mining2020_silicon = 8000000
plt.rcParams.update({'font.size': 10})
plt.rcParams['figure.figsize'] = (12, 8)
keywords=['VirginStock_']
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
fig, axs = plt.subplots(1,1, figsize=(4, 6), facecolor='w', edgecolor='k')
fig.subplots_adjust(hspace = .3, wspace=.2)
i = 0
obj = SFscenarios[2]
# Loop over Keywords
ii = 0
keyw = keywords[ii]
# Loop over SF Scenarios
# ROW 2, Aluminum and Silicon: g- 4 aluminum k - 1 silicon orange - 3 copper gray - 2 silver
axs.plot(USyearly[keyw+materials[2]+'_'+SFscenarios[2]]*100/mining2020_silver,
color = 'gray', linewidth=2.0, label='Silver')
axs.fill_between(USyearly.index, USyearly[keyw+materials[2]+'_'+SFscenarios[0]]*100/mining2020_silver,
USyearly[keyw+materials[2]+'_'+SFscenarios[2]]*100/mining2020_silver,
color='gray', lw=3, alpha=.3)
axs.plot(USyearly[keyw+materials[1]+'_'+SFscenarios[2]]*100/mining2020_silicon,
color = 'k', linewidth=2.0, label='Silicon')
axs.fill_between(USyearly.index, USyearly[keyw+materials[1]+'_'+SFscenarios[0]]*100/mining2020_silicon,
USyearly[keyw+materials[1]+'_'+SFscenarios[2]]*100/mining2020_silicon,
color='k', lw=3, alpha=.5)
axs.plot(USyearly[keyw+materials[4]+'_'+SFscenarios[2]]*100/mining2020_aluminum,
color = 'g', linewidth=2.0, label='Aluminum')
axs.fill_between(USyearly.index, USyearly[keyw+materials[4]+'_'+SFscenarios[0]]*100/mining2020_aluminum,
USyearly[keyw+materials[4]+'_'+SFscenarios[2]]*100/mining2020_aluminum,
color='g', lw=3, alpha=.3)
axs.plot(USyearly[keyw+materials[3]+'_'+SFscenarios[2]]*100/mining2020_copper,
color = 'orange', linewidth=2.0, label='Copper')
axs.fill_between(USyearly.index, USyearly[keyw+materials[3]+'_'+SFscenarios[0]]*100/mining2020_copper,
USyearly[keyw+materials[3]+'_'+SFscenarios[2]]*100/mining2020_copper,
color='orange', lw=3, alpha=.3)
axs.set_xlim([2020,2050])
axs.legend()
#axs.set_yscale('log')
axs.minorticks_on()
axs.set_ylabel('Virgin material needs as a percentage \nof 2020 global mining production capacity [%]')
fig.savefig(title_Method+' Fig_1x1_MaterialNeeds Ratio to Production.png', bbox_inches = "tight", dpi=600)
plt.show()
keyw='VirginStock_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
newdf = pd.DataFrame()
newdf['Silver_Ref'] = USyearly[keyw+materials[2]+'_'+SFscenarios[0]]*100/mining2020_silver
newdf['Silver_High'] = USyearly[keyw+materials[2]+'_'+SFscenarios[2]]*100/mining2020_silver
newdf['Silicon_Ref'] = USyearly[keyw+materials[1]+'_'+SFscenarios[0]]*100/mining2020_silicon
newdf['Silicon_High'] = USyearly[keyw+materials[1]+'_'+SFscenarios[2]]*100/mining2020_silicon
newdf['Aluminium_Ref'] = USyearly[keyw+materials[4]+'_'+SFscenarios[0]]*100/mining2020_aluminum
newdf['Aluminum_High'] = USyearly[keyw+materials[4]+'_'+SFscenarios[2]]*100/mining2020_aluminum
newdf['Copper_Ref'] = USyearly[keyw+materials[3]+'_'+SFscenarios[0]]*100/mining2020_copper
newdf['Copper_High'] = USyearly[keyw+materials[3]+'_'+SFscenarios[2]]*100/mining2020_copper
newdf['Copper_Ref'] = USyearly[keyw+materials[3]+'_'+SFscenarios[0]]*100/mining2020_copper
newdf['Copper_High'] = USyearly[keyw+materials[3]+'_'+SFscenarios[2]]*100/mining2020_copper
newdf.to_csv(title_Method+' Demand as Percentage of Mining.csv')
# FIGURE 4
import matplotlib as mpl
plt.rcParams.update({'font.size': 10})
plt.rcParams['figure.figsize'] = (12, 8)
keywords=['VirginStock_']
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminum']
fig, axs = plt.subplots(3,3, figsize=(15, 10), facecolor='w', edgecolor='k')
fig.subplots_adjust(hspace = .3, wspace=.2)
axs = axs.ravel()
i = 0
# Loop over Keywords
ii = 0
keyw = keywords[ii]
# Loop over SF Scenarios
titlesscens = ['Reference Scenario', 'Decarbonization Scenario', 'Decarbonization + Electrification Scenario']
for kk in range(0, 3):
obj = SFscenarios[kk]
axs[i].yaxis.grid()
axs[i].axvspan(2000, 2018, facecolor='c', alpha=0.5)
# axs[i].axvspan(2018, 2050.5, facecolor='yellow', alpha=0.1)
# axs[i].plot([],[],color='c', label='glass', linewidth=5)
# axs[i].plot([],[],color='k', label='silicon', linewidth=5)
# axs[i].plot([],[],color='m', label='silver', linewidth=5)
# axs[i].plot([],[],color='r', label='copper', linewidth=5)
# axs[i].plot([],[],color='g', label='aluminum', linewidth=5)
axs[i].stackplot(rr.scenario[obj].data['year'], USyearly[keyw+materials[0]+'_'+obj]/1e6,
USyearly[keyw+materials[1]+'_'+obj]/1e6,
USyearly[keyw+materials[4]+'_'+obj]/1e6,
colors=['c','k','g'], labels=['Glass','Si','Al'])
#USyearly[keyw+materials[2]+'_'+obj]/1e6,
#USyearly[keyw+materials[3]+'_'+obj]/1e6,
#axs[i].ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title(titlesscens[kk])
axs[i].legend(loc='center right',bbox_to_anchor=(1,0.55))
#axs[i].legend(materials)
i += 1
# 2nd axis plot
i = 0
for kk in range(0, 3):
obj = SFscenarios[kk]
ax2=axs[i].twinx()
module = (UScum[keyw+materials[0]+'_'+obj]/1e6 +
UScum[keyw+materials[1]+'_'+obj]/1e6 +
UScum[keyw+materials[2]+'_'+obj]/1e6 +
UScum[keyw+materials[3]+'_'+obj]/1e6 +
UScum[keyw+materials[4]+'_'+obj]/1e6)
ax2.plot(rr.scenario[obj].data['year'], module,
color = 'r', linewidth=4.0, label='cumulative')
#axs[i].ylabel('Mass [Tons]')
# axs[i].set_xlim([2010, 2050])
# axs[i].set_title(keyw+ ' Yearly ' + obj.name)
#axs[i].legend(materials)
ax2.set_yscale('log')
# ax2.set_ylim([1e3/1e6, 1e8/1e6])
ax2.set_ylim([1e0, 1e2])
i += 1
ax2.legend()
i = 3
# ROW 2, Aluminum and Silicon:
# Loop over SF Scenarios
for kk in range(0, 3):
obj = SFscenarios[kk]
axs[i].yaxis.grid()
# axs[i].axvspan(2000, 2018, facecolor='0.9', alpha=0.5)
axs[i].plot(rr.scenario[obj].data['year'], USyearly[keyw+materials[4]+'_'+obj]/1e6, color='g', lw=3, label='Aluminum')
# axs[i].fill_between(obj.scenario[STATEs[0]].data['year'], 0, USyearly[keyw+materials[4]+'_'+obj.name],
# color='g', lw=3, alpha=.6)
axs[i].plot(rr.scenario[obj].data['year'], USyearly[keyw+materials[1]+'_'+obj]/1e6, color='k', lw=3, label='Silicon')
# axs[i].fill_between(obj.scenario[STATEs[0]].data['year'], 0, USyearly[keyw+materials[1]+'_'+obj.name],
# color='k', lw=3)# alpha=.3)
# silicon aluminum 'k ''g'
#axs[i].ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
#axs[i].set_title(keyw+ ' Yearly ' + obj.name)
#axs[i].legend(materials)
axs[i].legend()
i += 1
# ROW 3:
# Loop over SF Scenarios
for kk in range(0, 3):
obj = SFscenarios[kk]
axs[i].yaxis.grid()
axs[i].plot(rr.scenario[obj].data['year'], USyearly[keyw+materials[3]+'_'+obj], color='orange', lw=3, label='Copper')
# axs[i].fill_between(obj.scenario[STATEs[0]].data['year'], 0, USyearly[keyw+materials[3]+'_'+obj.name],
# color='orange', lw=3)# alpha=.3)
axs[i].plot(rr.scenario[obj].data['year'], USyearly[keyw+materials[2]+'_'+obj], color='gray', lw=3, label='Silver')
# axs[i].fill_between(obj.scenario[STATEs[0]].data['year'], 0, USyearly[keyw+materials[2]+'_'+obj.name],
# color='gray', lw=3)# , alpha=.6)
#axs[i].ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
#axs[i].set_title(keyw+ ' Yearly ' + obj.name)
axs[i].legend()
axs[i].yaxis.set_major_formatter(mpl.ticker.StrMethodFormatter('{x:,.0f}'))
i += 1
for i in range (0, 3):
axs[i].set_ylim([0, 0.8e7/1e6])
axs[i].minorticks_on()
#a0.tick_params(axis='y', which='minor', bottom=False)
# axs[i].set_ylim([0, 1e7/1e6])
axs[i+3].set_ylim([0, 0.5e6/1e6])
axs[i+3].minorticks_on()
axs[i+6].set_ylim([0, 3500])
#axs[i+3].set_ylim([1e0, 10e8])
#axs[i+6].set_ylim([1e0, 5e6])
# axs[i+3].set_yscale('log')
# axs[i+6].set_yscale('log')
axs[0].set_ylabel('Mass [Tons]')
axs[3].set_ylabel('Mass [Tons]')
#axs[5].legend(materials)
axs[0].set_ylabel('Yearly Mass [Million Tonnes]')
axs[3].set_ylabel('Yearly Mass [Million Tonnes]')
axs[6].set_ylabel('Yearly Mass [Tonnes]')
#axs[8].legend(materials)
fig.savefig(title_Method+' SF Figure 4 - MaterialNeeds Nation.png', dpi=600)
plt.show()
keyword='Cumulative_Area_disposed'
USyearly_Areadisp=pd.DataFrame()
# Loop over SF Scenarios
for kk in range(0, 3):
obj = SFscenarios[kk]
# Loop over Materials
foo = rr.scenario[obj].data[keyword].copy()
USyearly_Areadisp["Areadisp_"+obj] = foo
# Loop over STATEs
#for jj in range (1, len(STATEs)):
# USyearly_Areadisp["Areadisp_"+obj] += rr.scenario[obj].data[keyword]
UScum_Areadisp = USyearly_Areadisp.copy()
UScum_Areadisp = UScum_Areadisp.cumsum()
A = UScum['Waste_Module_Reference.Mod'].iloc[-1]
#47700000 # tonnes cumulative by 2050
A = A*1000 # convert to kg
A = A/10.05599 # convert to m2 if each m2 is ~avg 10 kg
#A = A*2 # convert to area if each module is ~2 m2
A = A/1e6 # Convert to km 2
print(A)
755.6564601943501
B = UScum['Waste_Module_95-by-35_Elec.Adv_DR'].iloc[-1]
#47700000 # tonnes cumulative by 2050
B = B*1000 # convert to kg
B= B/10.05599 # convert to m2 if each m2 is ~avg 10 kg
#A = A*2 # convert to area if each module is ~2 m2
B =B/1e6 # Convert to km 2
print(B)
1077.8757878114952
C = UScum_Areadisp['Areadisp_Reference.Mod'].iloc[-1]/1e6
D = UScum_Areadisp['Areadisp_95-by-35_Elec.Adv_DR'].iloc[-1]/1e6
# MANHATTAN SIZE:
manhattans = 59.103529
print("Reference Cumulative Area by 2050 of Waste PV Modules EoL", round(C), " km^2")
print("High Electrification Cumulative Area by 2050 of Waste PV Modules EoL", round(D), " km^2")
print("")
print("Reference Waste equals ", round(C/manhattans), " Manhattans ")
print("High Electrification equals ", round(D/manhattans), " Manhattans ")
print("")
print ("MFG SCrap + Eol Waste")
print("Reference Cumulative Area by 2050 of Waste PV Mfg + Modules EoL", round(A), " km^2")
print("High Electrification Cumulative Area by 2050 of Waste PV Mfg + Modules EoL", round(B), " km^$")
Reference Cumulative Area by 2050 of Waste PV Modules EoL 560 km^2 High Electrification Cumulative Area by 2050 of Waste PV Modules EoL 683 km^2 Reference Waste equals 9 Manhattans High Electrification equals 12 Manhattans MFG SCrap + Eol Waste Reference Cumulative Area by 2050 of Waste PV Mfg + Modules EoL 756 km^2 High Electrification Cumulative Area by 2050 of Waste PV Mfg + Modules EoL 1078 km^$
VirginStock_aluminum_Reference.Mod
VirginStock_aluminum_95-by-35.Adv
VirginStock_aluminum_95-by-35_Elec.Adv_DR
Waste_EOL_aluminum_Reference.Mod
Waste_EOL_aluminum_95-by-35.Adv
Waste_EOL_aluminum_95-by-35_Elec.Adv_DR
VirginStock_silver_Reference.Mod
VirginStock_silver_95-by-35.Adv
VirginStock_silver_95-by-35_Elec.Adv_DR
Waste_EOL_silver_Reference.Mod
Waste_EOL_silver_95-by-35.Adv
Waste_EOL_silver_95-by-35_Elec.Adv_DR
USyearly['VirginStock_silver_Reference.Mod']
year 2010 128.426774 2011 219.915502 2012 172.505147 2013 234.947057 2014 214.149815 2015 321.420822 2016 283.204082 2017 269.165286 2018 273.761119 2019 465.757234 2020 382.744131 2021 91.373232 2022 82.747506 2023 231.970049 2024 212.484190 2025 407.290500 2026 380.662842 2027 338.591666 2028 315.521303 2029 489.351669 2030 452.797028 2031 131.150695 2032 130.404439 2033 116.233802 2034 115.657615 2035 122.605382 2036 122.066957 2037 206.839493 2038 206.024174 2039 201.195632 2040 200.476230 2041 181.903956 2042 181.308816 2043 331.327899 2044 330.328800 2045 256.781267 2046 256.063206 2047 402.562428 2048 401.512942 2049 279.696766 2050 279.013840 Name: VirginStock_silver_Reference.Mod, dtype: float64
USyearly
| VirginStock_glass_Reference.Mod | VirginStock_silicon_Reference.Mod | VirginStock_silver_Reference.Mod | VirginStock_copper_Reference.Mod | VirginStock_aluminum_Reference.Mod | VirginStock_Module_Reference.Mod | VirginStock_glass_95-by-35.Adv | VirginStock_silicon_95-by-35.Adv | VirginStock_silver_95-by-35.Adv | VirginStock_copper_95-by-35.Adv | ... | Waste_MFG_silver_95-by-35_Elec.Adv_DR | Waste_MFG_copper_95-by-35_Elec.Adv_DR | Waste_MFG_aluminum_95-by-35_Elec.Adv_DR | Waste_MFG_Module_95-by-35_Elec.Adv_DR | new_Installed_Capacity_[MW]Reference.Mod | new_Installed_Capacity_[MW]95-by-35.Adv | new_Installed_Capacity_[MW]95-by-35_Elec.Adv_DR | Capacity_Reference.Mod | Capacity_95-by-35.Adv | Capacity_95-by-35_Elec.Adv_DR | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| year | |||||||||||||||||||||
| 2010 | 7.018429e+04 | 7082.020411 | 128.426774 | 49.784053 | 16728.966195 | 9.417348e+04 | 7.018429e+04 | 7082.020411 | 128.426774 | 49.784053 | ... | 27.740183 | 5.874518 | 498.523193 | 9032.812399 | 1200.651350 | 1200.651350 | 1200.651350 | 1.200651e+09 | 1.200651e+09 | 1.200651e+09 |
| 2011 | 1.442186e+05 | 14456.874009 | 219.915502 | 102.299090 | 34020.002590 | 1.930177e+05 | 1.442186e+05 | 14456.874009 | 219.915502 | 102.299090 | ... | 47.501748 | 12.071293 | 1013.796077 | 18445.373832 | 2534.300109 | 2534.300109 | 2534.300109 | 3.731350e+09 | 3.731350e+09 | 3.731350e+09 |
| 2012 | 1.428233e+05 | 14473.896289 | 172.505147 | 100.306250 | 33296.094628 | 1.908661e+05 | 1.428233e+05 | 14473.896289 | 172.505147 | 100.306250 | ... | 37.261112 | 11.836138 | 992.223620 | 18471.131942 | 2534.300109 | 2534.300109 | 2534.300109 | 6.254456e+09 | 6.254456e+09 | 6.254456e+09 |
| 2013 | 2.806388e+05 | 27437.479671 | 234.947057 | 195.163190 | 53446.058911 | 3.619524e+05 | 2.806387e+05 | 27437.472114 | 234.946992 | 195.163136 | ... | 50.748550 | 23.029250 | 1592.692117 | 35045.028655 | 5123.033732 | 5123.032321 | 5123.032321 | 1.135873e+10 | 1.135872e+10 | 1.135872e+10 |
| 2014 | 2.793654e+05 | 26818.242077 | 214.149815 | 191.571229 | 51596.845772 | 3.581862e+05 | 2.793653e+05 | 26818.234691 | 214.149756 | 191.571176 | ... | 46.256347 | 22.605399 | 1537.585581 | 33977.393769 | 5123.033732 | 5123.032321 | 5123.032321 | 1.644768e+10 | 1.644767e+10 | 1.644767e+10 |
| 2015 | 4.899909e+05 | 47187.198999 | 321.420822 | 365.863028 | 85920.524941 | 6.237859e+05 | 4.899912e+05 | 47187.224863 | 321.420998 | 365.863228 | ... | 69.426936 | 43.171861 | 2560.433047 | 57897.071230 | 9477.537310 | 9477.542505 | 9477.542505 | 2.587584e+10 | 2.587584e+10 | 2.587584e+10 |
| 2016 | 4.711404e+05 | 43370.444699 | 283.204082 | 380.717617 | 78848.372123 | 5.940232e+05 | 4.711407e+05 | 43370.468471 | 283.204237 | 380.717825 | ... | 61.172115 | 44.924703 | 2349.682777 | 52399.071958 | 9477.537310 | 9477.542505 | 9477.542505 | 3.527563e+10 | 3.527563e+10 | 3.527563e+10 |
| 2017 | 4.563168e+05 | 37304.395438 | 269.165286 | 422.537380 | 73575.142034 | 5.678880e+05 | 4.563165e+05 | 37304.378239 | 269.165162 | 422.537185 | ... | 58.139675 | 49.859388 | 2192.538222 | 45378.446953 | 9156.783125 | 9156.778903 | 9156.778903 | 4.432621e+10 | 4.432621e+10 | 4.432621e+10 |
| 2018 | 4.407763e+05 | 32803.994115 | 273.761119 | 420.618002 | 69844.890554 | 5.441196e+05 | 4.407761e+05 | 32803.978991 | 273.760993 | 420.617808 | ... | 59.132374 | 49.632901 | 2081.376779 | 39777.903104 | 9156.783125 | 9156.778903 | 9156.778903 | 5.334901e+10 | 5.334901e+10 | 5.334901e+10 |
| 2019 | 8.022008e+05 | 55529.114850 | 465.757234 | 824.668750 | 121936.332340 | 9.809567e+05 | 7.954251e+05 | 55060.092196 | 461.823249 | 817.703245 | ... | 101.145287 | 97.834907 | 3653.269251 | 68667.328612 | 16904.814950 | 16762.029653 | 16995.842998 | 7.009141e+10 | 6.994862e+10 | 7.018244e+10 |
| 2020 | 7.845582e+05 | 48511.986589 | 382.744131 | 778.416420 | 113139.379375 | 9.473708e+05 | 7.779315e+05 | 48102.233601 | 379.511311 | 771.841582 | ... | 83.117904 | 92.347743 | 3389.708447 | 62502.400271 | 16904.814950 | 16762.029653 | 16995.842998 | 8.678082e+10 | 8.649568e+10 | 8.696260e+10 |
| 2021 | 2.014970e+05 | 12144.506011 | 91.373232 | 201.031193 | 28586.894904 | 2.425208e+05 | 2.038239e+05 | 12284.754131 | 92.428435 | 203.352757 | ... | 20.810539 | 25.012439 | 898.242981 | 16147.992909 | 4479.833668 | 4531.568028 | 4723.593023 | 9.095616e+10 | 9.072390e+10 | 9.138098e+10 |
| 2022 | 1.972441e+05 | 11572.391967 | 82.747506 | 197.692158 | 27497.178308 | 2.365941e+05 | 1.995219e+05 | 11706.033155 | 83.703097 | 199.975162 | ... | 18.846003 | 24.596994 | 864.002456 | 15336.755089 | 4479.833668 | 4531.568028 | 4723.593023 | 9.510092e+10 | 9.492127e+10 | 9.576755e+10 |
| 2023 | 5.876418e+05 | 33306.015492 | 231.970049 | 596.534310 | 79490.400904 | 7.012668e+05 | 1.740481e+06 | 98645.946912 | 687.050217 | 1766.818726 | ... | 125.582329 | 176.425072 | 5937.092552 | 101903.103484 | 13634.589691 | 40383.005620 | 34173.144328 | 1.083635e+11 | 1.349329e+11 | 1.295655e+11 |
| 2024 | 5.774328e+05 | 31411.747254 | 212.484190 | 593.245725 | 75647.986418 | 6.852983e+05 | 1.710244e+06 | 93035.492425 | 629.336887 | 1757.078575 | ... | 115.033210 | 175.452472 | 5650.104813 | 94583.418054 | 13634.589691 | 40383.005620 | 34173.144328 | 1.215336e+11 | 1.747183e+11 | 1.631684e+11 |
| 2025 | 1.172042e+06 | 62055.099995 | 407.290500 | 1166.768295 | 149852.310390 | 1.385523e+06 | 2.717327e+06 | 143872.011133 | 944.285052 | 2705.100808 | ... | 230.039851 | 360.007603 | 11676.824513 | 191573.113976 | 28006.324744 | 64931.428129 | 73232.045758 | 1.489687e+11 | 2.388122e+11 | 2.356211e+11 |
| 2026 | 1.158703e+06 | 59869.090073 | 380.662842 | 1117.797678 | 144657.227064 | 1.364728e+06 | 2.686401e+06 | 138803.843587 | 882.550002 | 2591.564594 | ... | 215.000407 | 344.897667 | 11272.012094 | 178232.362718 | 28006.324744 | 64931.428129 | 73232.045758 | 1.762047e+11 | 3.025239e+11 | 3.076498e+11 |
| 2027 | 1.091469e+06 | 55065.927170 | 338.591666 | 1018.300894 | 132846.385677 | 1.280738e+06 | 1.611470e+06 | 81300.609591 | 499.904574 | 1503.443013 | ... | 170.187738 | 279.612371 | 9212.219072 | 142769.571494 | 26628.140384 | 39314.402876 | 61963.949007 | 2.018361e+11 | 3.402097e+11 | 3.679600e+11 |
| 2028 | 1.087800e+06 | 53748.963838 | 315.521303 | 973.886665 | 129491.211295 | 1.272330e+06 | 1.606053e+06 | 79356.214441 | 465.842956 | 1437.868817 | ... | 158.591785 | 267.416793 | 8979.554847 | 135712.069152 | 26628.140384 | 39314.402876 | 61963.949007 | 2.272122e+11 | 3.775799e+11 | 4.278414e+11 |
| 2029 | 1.809482e+06 | 87653.625830 | 489.351669 | 1554.185968 | 210842.546559 | 2.110021e+06 | 2.324661e+06 | 112609.578471 | 628.675479 | 1996.679830 | ... | 193.320389 | 335.419128 | 11491.516681 | 165699.047313 | 44459.751214 | 57117.932039 | 81314.849571 | 2.701207e+11 | 4.323945e+11 | 5.066020e+11 |
| 2030 | 1.805498e+06 | 85658.543712 | 452.797028 | 1484.231439 | 205677.973845 | 2.098772e+06 | 2.319544e+06 | 110046.474502 | 581.713329 | 1906.808476 | ... | 178.879328 | 320.321780 | 11210.032823 | 156850.124260 | 44459.751214 | 57117.932039 | 81314.849571 | 3.125903e+11 | 4.867107e+11 | 5.847444e+11 |
| 2031 | 5.229548e+05 | 24810.625586 | 131.150695 | 429.901197 | 59573.732862 | 6.079002e+05 | 1.521068e+06 | 72164.274809 | 381.465383 | 1250.412169 | ... | 107.567663 | 192.622958 | 6741.064191 | 94320.576281 | 12957.187354 | 37687.321738 | 49200.342205 | 3.230655e+11 | 5.210452e+11 | 6.301018e+11 |
| 2032 | 5.199791e+05 | 24669.451544 | 130.404439 | 427.455032 | 59234.754522 | 6.044412e+05 | 1.512413e+06 | 71753.655483 | 379.294821 | 1243.297244 | ... | 106.955596 | 191.526921 | 6702.707106 | 93783.886186 | 12957.187354 | 37687.321738 | 49200.342205 | 3.327496e+11 | 5.544692e+11 | 6.744935e+11 |
| 2033 | 4.634747e+05 | 21988.700426 | 116.233802 | 381.004849 | 52797.901472 | 5.387585e+05 | 2.092666e+06 | 99282.682045 | 524.815172 | 1720.300996 | ... | 217.825212 | 390.062734 | 13650.698544 | 190999.776425 | 11610.688533 | 52424.212235 | 100734.892095 | 3.411871e+11 | 6.026108e+11 | 7.703453e+11 |
| 2034 | 4.611772e+05 | 21879.699388 | 115.657615 | 379.116155 | 52536.174951 | 5.360878e+05 | 2.082292e+06 | 98790.524019 | 522.213591 | 1711.773225 | ... | 216.745422 | 388.129139 | 13583.030138 | 190052.964041 | 11610.688533 | 52424.212235 | 100734.892095 | 3.485492e+11 | 6.494773e+11 | 8.646828e+11 |
| 2035 | 4.888809e+05 | 23194.053430 | 122.605382 | 401.890364 | 55692.120225 | 5.682916e+05 | 2.690067e+06 | 127625.273162 | 674.636083 | 2211.401626 | ... | 192.503581 | 344.718926 | 12063.839314 | 168796.534803 | 12365.754090 | 68042.558766 | 89886.844265 | 3.563254e+11 | 7.114210e+11 | 9.473932e+11 |
| 2036 | 4.867340e+05 | 23092.196125 | 122.066957 | 400.125452 | 55447.546791 | 5.657959e+05 | 2.678254e+06 | 127064.803365 | 671.673401 | 2201.690196 | ... | 191.658197 | 343.205084 | 12010.860642 | 168055.260310 | 12365.754090 | 68042.558766 | 89886.844265 | 3.641805e+11 | 7.731671e+11 | 1.029801e+12 |
| 2037 | 8.247589e+05 | 39129.165183 | 206.839493 | 678.002854 | 93954.520638 | 9.587274e+05 | 1.040769e+06 | 49377.354606 | 261.012136 | 855.576325 | ... | 127.393125 | 228.124698 | 7983.488844 | 111704.509432 | 21040.884630 | 26551.632695 | 59996.065785 | 3.776213e+11 | 7.900527e+11 | 1.078845e+12 |
| 2038 | 8.215079e+05 | 38974.926057 | 206.024174 | 675.330307 | 93584.171231 | 9.549483e+05 | 1.036666e+06 | 49182.719224 | 259.983279 | 852.203819 | ... | 126.890968 | 227.225477 | 7952.019572 | 111264.193217 | 21040.884630 | 26551.632695 | 59996.065785 | 3.928940e+11 | 8.087334e+11 | 1.129521e+12 |
| 2039 | 8.022544e+05 | 38061.479491 | 201.195632 | 659.502742 | 91390.860081 | 9.325674e+05 | 3.234938e+05 | 15347.564865 | 81.128297 | 265.931888 | ... | 28.684433 | 51.365626 | 1797.599775 | 25151.911014 | 20625.094015 | 8316.675349 | 13613.503685 | 4.067937e+11 | 8.081709e+11 | 1.132646e+12 |
| 2040 | 7.993858e+05 | 37925.385582 | 200.476230 | 657.144602 | 91064.079842 | 9.292329e+05 | 3.223371e+05 | 15292.687595 | 80.838212 | 264.981013 | ... | 28.581868 | 51.181962 | 1791.172216 | 25061.976993 | 20625.094015 | 8316.675349 | 13613.503685 | 4.187501e+11 | 8.056806e+11 | 1.133824e+12 |
| 2041 | 7.253301e+05 | 34411.948436 | 181.903956 | 596.266216 | 82627.832830 | 8.431480e+05 | 3.543131e+05 | 16809.730398 | 88.857406 | 291.267272 | ... | 77.181043 | 138.209201 | 4836.791549 | 67676.104741 | 18778.534321 | 9173.037667 | 36887.263407 | 4.297536e+11 | 8.049210e+11 | 1.159132e+12 |
| 2042 | 7.229570e+05 | 34299.361950 | 181.308816 | 594.315396 | 82357.497155 | 8.403895e+05 | 3.531539e+05 | 16754.733556 | 88.566689 | 290.314325 | ... | 76.928527 | 137.757018 | 4820.966890 | 67454.687032 | 18778.534321 | 9173.037667 | 36887.263407 | 4.403014e+11 | 8.036218e+11 | 1.183773e+12 |
| 2043 | 1.321148e+06 | 62679.442535 | 331.327899 | 1086.065618 | 150501.983615 | 1.535747e+06 | 4.928646e+05 | 23383.051811 | 123.604441 | 405.165196 | ... | 92.162616 | 165.036919 | 5775.658724 | 80812.679393 | 34424.361314 | 12842.274781 | 44331.142777 | 4.657812e+11 | 8.051208e+11 | 1.214862e+12 |
| 2044 | 1.317164e+06 | 62490.436489 | 330.328800 | 1082.790653 | 150048.154039 | 1.531116e+06 | 4.913784e+05 | 23312.541641 | 123.231719 | 403.943445 | ... | 91.884705 | 164.539260 | 5758.242576 | 80568.993675 | 34424.361314 | 12842.274781 | 44331.142777 | 4.916949e+11 | 8.068549e+11 | 1.246050e+12 |
| 2045 | 1.023898e+06 | 48576.973797 | 256.781267 | 841.707886 | 116640.011761 | 1.190214e+06 | 9.645058e+05 | 45759.200650 | 241.886322 | 792.883480 | ... | 148.783663 | 266.429040 | 9323.993797 | 130460.776414 | 26837.672654 | 25280.917109 | 71991.796050 | 5.110134e+11 | 8.216844e+11 | 1.305422e+12 |
| 2046 | 1.021035e+06 | 48441.133560 | 256.063206 | 839.354141 | 116313.840623 | 1.186886e+06 | 9.618087e+05 | 45631.240010 | 241.209913 | 790.666267 | ... | 148.367605 | 265.684000 | 9297.920260 | 130095.957008 | 26837.672654 | 25280.917109 | 71991.796050 | 5.300483e+11 | 8.356211e+11 | 1.363699e+12 |
| 2047 | 1.605191e+06 | 76155.339399 | 402.562428 | 1319.566550 | 182859.470011 | 1.865928e+06 | 1.991206e+06 | 94469.072431 | 499.370097 | 1636.894129 | ... | 87.656616 | 156.967961 | 5493.276145 | 76861.598845 | 42306.236152 | 52479.982610 | 42648.336864 | 5.647905e+11 | 8.761737e+11 | 1.391849e+12 |
| 2048 | 1.601007e+06 | 75956.801268 | 401.512942 | 1316.126419 | 182382.752584 | 1.861064e+06 | 1.986014e+06 | 94222.790119 | 498.068231 | 1632.626721 | ... | 87.428094 | 156.558743 | 5478.955090 | 76661.219485 | 42306.236152 | 52479.982610 | 42648.336864 | 5.989320e+11 | 9.150023e+11 | 1.418354e+12 |
| 2049 | 1.115273e+06 | 52912.046993 | 279.696766 | 916.823007 | 127049.120215 | 1.296430e+06 | 1.252184e+06 | 59407.561374 | 314.032507 | 1029.372745 | ... | 143.123135 | 256.292653 | 8969.259151 | 125497.349974 | 29545.326875 | 33172.328787 | 69993.457237 | 6.194240e+11 | 9.322600e+11 | 1.470007e+12 |
| 2050 | 1.112549e+06 | 52782.853553 | 279.013840 | 914.584433 | 126738.908951 | 1.293265e+06 | 1.249127e+06 | 59262.508070 | 313.265745 | 1026.859363 | ... | 142.773677 | 255.666873 | 8947.359234 | 125190.927612 | 29545.326875 | 33172.328787 | 69993.457237 | 6.389314e+11 | 9.469730e+11 | 1.518920e+12 |
41 rows × 78 columns
plt.rcParams.update({'font.size': 14})
plt.rcParams['figure.figsize'] = (12, 8)
fig, axs = plt.subplots(1,3, figsize=(16, 4), facecolor='w', edgecolor='k')
fig.subplots_adjust(hspace = .1, wspace=.6)
axs = axs.ravel()
# PLOT 1
i = 0
axs[i].yaxis.grid()
lns1 = axs[i].plot(USyearly.index, USyearly['VirginStock_silver_95-by-35_Elec.Adv_DR']/1e6, color='gray', linewidth=4.0, label='Virgin Material Demands')
lns2 = axs[i].plot(USyearly.index, USyearly['Waste_EOL_silver_95-by-35_Elec.Adv_DR']/1e6, color='gray', linestyle='dashed', linewidth=3.0, label='EoL Material')
axs[i].set_ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title('Silver')
# 2nd axis plot
ax2=axs[i].twinx()
lns3 = ax2.plot(USyearly.index, USyearly['Waste_EOL_silver_95-by-35_Elec.Adv_DR']/USyearly['VirginStock_silver_95-by-35_Elec.Adv_DR'],
color = 'r', linewidth=1.0, label='Eol Material as fraction of Demand')
ax2.set_ylabel('EoL Material as Fraction of Demand', color='r')
ax2.tick_params(axis='y', labelcolor='r')
# LEGENDS
# added these three lines
lns = lns1+lns2+lns3
labs = [l.get_label() for l in lns]
#axs[0].legend(lns, labs, loc=0)
# PLOT 2
i = 1
axs[i].yaxis.grid()
lns1 = axs[i].plot(USyearly.index, USyearly['VirginStock_aluminum_95-by-35_Elec.Adv_DR']/1e6, color='g', linewidth=4.0, label='Virgin Material Demands')
lns2 = axs[i].plot(USyearly.index, USyearly['Waste_EOL_aluminum_95-by-35_Elec.Adv_DR']/1e6, color='g', linestyle='dashed', linewidth=3.0, label='EoL Material')
axs[i].set_ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title('Aluminum')
# 2nd axis plot
ax2=axs[i].twinx()
lns3 = ax2.plot(USyearly.index, USyearly['Waste_EOL_aluminum_95-by-35_Elec.Adv_DR']/USyearly['VirginStock_aluminum_95-by-35_Elec.Adv_DR'],
color = 'r', linewidth=1.0, label='Eol Material as fraction of Demand')
ax2.set_ylabel('EoL Material as Fraction of Demand', color='r')
ax2.tick_params(axis='y', labelcolor='r')
# LEGENDS
# added these three lines
lns = lns1+lns2+lns3
labs = [l.get_label() for l in lns]
#axs[1].legend(lns, labs, loc=0)
# PLOT 3
i = 2
axs[i].yaxis.grid()
lns1 = axs[i].plot(USyearly.index, USyearly['VirginStock_silicon_95-by-35_Elec.Adv_DR']/1e6, color='k', linewidth=4.0, label='Virgin Material Demands')
lns2 = axs[i].plot(USyearly.index, USyearly['Waste_EOL_silicon_95-by-35_Elec.Adv_DR']/1e6, color='k', linestyle='dashed', linewidth=3.0, label='EoL Material')
axs[i].set_ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title('Silicon')
# 2nd axis plot
ax2=axs[i].twinx()
lns3 = ax2.plot(USyearly.index, USyearly['Waste_EOL_silicon_95-by-35_Elec.Adv_DR']/USyearly['VirginStock_silicon_95-by-35_Elec.Adv_DR'],
color = 'r', linewidth=1.0, label='Eol Material as fraction of Demand')
#ax2.set_ylabel('EoL Material as Fraction of Demand', color='r')
ax2.tick_params(axis='y', labelcolor='r')
# LEGENDS
# added these three lines
lns = lns1+lns2+lns3
labs = [l.get_label() for l in lns]
axs[2].legend(lns, labs, loc='upper center', bbox_to_anchor=(-0.95, -0.25),
fancybox=True, shadow=True, ncol=5)
fig.savefig(title_Method+' Fig_1x3_VirginvsWaste_Fraction_Nation.png', bbox_inches = "tight", dpi=600)
from matplotlib.legend_handler import HandlerBase
plt.rcParams.update({'font.size': 14})
plt.rcParams['figure.figsize'] = (12, 8)
class AnyObjectHandler(HandlerBase):
def create_artists(self, legend, orig_handle,
x0, y0, width, height, fontsize, trans):
if orig_handle[0] is 'r':
l1 = plt.Line2D([x0,y0+width], [0.4*height,0.4*height], color=orig_handle[0])
return [l1]
else:
l1 = plt.Line2D([x0,y0+width], [0.7*height,0.7*height], color=orig_handle[0], linestyle = orig_handle[3],)
l2 = plt.Line2D([x0,y0+width], [0.4*height,0.4*height], color=orig_handle[1], linestyle = orig_handle[4])
l3 = plt.Line2D([x0,y0+width], [0.1*height,0.1*height], color=orig_handle[2], linestyle = orig_handle[5])
return [l1, l2, l3]
fig, axs = plt.subplots(1,3, figsize=(16, 4), facecolor='w', edgecolor='k')
fig.subplots_adjust(hspace = .1, wspace=.6)
axs = axs.ravel()
# PLOT 1
i = 0
axs[i].yaxis.grid()
lns1 = axs[i].plot(USyearly.index, USyearly['VirginStock_silver_Reference.Mod']/1e6, color='gray', linewidth=4.0, label='Virgin Material Demands')
lns2 = axs[i].plot(USyearly.index, USyearly['Waste_EOL_silver_Reference.Mod']/1e6, color='gray', linestyle='dashed', linewidth=3.0, label='EoL Material')
axs[i].set_ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title('Silver')
# 2nd axis plot
ax2=axs[i].twinx()
lns3 = ax2.plot(USyearly.index, USyearly['Waste_EOL_silver_Reference.Mod']/USyearly['VirginStock_silver_Reference.Mod'],
color = 'r', linewidth=1.0, label='Eol Material as fraction of Demand')
ax2.set_ylabel('EoL Material as Fraction of Demand', color='r')
ax2.tick_params(axis='y', labelcolor='r')
# LEGENDS
# added these three lines
lns = lns1+lns2+lns3
labs = [l.get_label() for l in lns]
#axs[0].legend(lns, labs, loc=0)
# PLOT 2
i = 1
axs[i].yaxis.grid()
lns1 = axs[i].plot(USyearly.index, USyearly['VirginStock_aluminum_Reference.Mod']/1e6, color='g', linewidth=4.0, label='Virgin Material Demands')
lns2 = axs[i].plot(USyearly.index, USyearly['Waste_EOL_aluminum_Reference.Mod']/1e6, color='g', linestyle='dashed', linewidth=3.0, label='EoL Material')
axs[i].set_ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title('Aluminum')
# 2nd axis plot
ax2=axs[i].twinx()
lns3 = ax2.plot(USyearly.index, USyearly['Waste_EOL_aluminum_Reference.Mod']/USyearly['VirginStock_aluminum_Reference.Mod'],
color = 'r', linewidth=1.0, label='Eol Material as fraction of Demand')
ax2.set_ylabel('EoL Material as Fraction of Demand', color='r')
ax2.tick_params(axis='y', labelcolor='r')
# LEGENDS
# added these three lines
lns = lns1+lns2+lns3
labs = [l.get_label() for l in lns]
#axs[1].legend(lns, labs, loc=0)
# PLOT 3
i = 2
axs[i].yaxis.grid()
lns1 = axs[i].plot(USyearly.index, USyearly['VirginStock_silicon_Reference.Mod']/1e6, color='k', linewidth=4.0, label='Virgin Material Demands')
lns2 = axs[i].plot(USyearly.index, USyearly['Waste_EOL_silicon_Reference.Mod']/1e6, color='k', linestyle='dashed', linewidth=3.0, label='EoL Material')
axs[i].set_ylabel('Mass [Tons]')
axs[i].set_xlim([2020, 2050])
axs[i].set_title('Silicon')
# 2nd axis plot
ax2=axs[i].twinx()
lns3 = ax2.plot(USyearly.index, USyearly['Waste_EOL_silicon_Reference.Mod']/USyearly['VirginStock_silicon_Reference.Mod'],
color = 'r', linewidth=1.0, label='EOl Material as fraction of Demand')
#ax2.set_ylabel('EoL Material as Fraction of Demand', color='r')
ax2.tick_params(axis='y', labelcolor='r')
# LEGENDS
# added these three lines
lns = lns1+lns2+lns3
labs = [l.get_label() for l in lns]
#axs[2].legend(lns, labs, loc='upper center', bbox_to_anchor=(-0.95, -0.25),
# fancybox=True, shadow=True, ncol=5)
#axs[2].legend([("gray","g","k","-","-","-"), ("gray","g","k","--","--","--"),("r","r","r","-","-","-")], ['Material Demands', "EoL Material", 'Fraction'],
# handler_map={tuple: AnyObjectHandler()}, loc='upper center', bbox_to_anchor=(-0.95, -0.25),
# fancybox=True, shadow=True, ncol=5)
axs[2].legend([("gray","g","k","-","-","-"), ("gray","g","k","--","--","--"),("r","r","r")], [' Virgin material demands', "EOL material", 'EOL material as fraction of demand'],
handler_map={tuple: AnyObjectHandler()}, loc='upper center', bbox_to_anchor=(-0.95, -0.25),
fancybox=True, shadow=True, ncol=5)
fig.savefig(title_Method+' Fig_1x3_VirginvsWaste_Fraction_Nation.png', bbox_inches = "tight", dpi=600)
<>:10: SyntaxWarning: "is" with a literal. Did you mean "=="? <>:10: SyntaxWarning: "is" with a literal. Did you mean "=="? <ipython-input-65-7d75c3d18428>:10: SyntaxWarning: "is" with a literal. Did you mean "=="? if orig_handle[0] is 'r':
newdf = pd.DataFrame()
newdf['Virgin material demands, Silicon, Reference'] = USyearly['VirginStock_silicon_Reference.Mod']/1e6
newdf['EOL material, Silicon, Reference'] = USyearly['Waste_EOL_silicon_Reference.Mod']/1e6
newdf['EOL material as fraction of demand, Silicon, Reference'] = USyearly['Waste_EOL_silicon_Reference.Mod']/USyearly['VirginStock_silicon_Reference.Mod']
newdf['Virgin material demands, Silver, Reference'] = USyearly['VirginStock_silver_Reference.Mod']/1e6
newdf['EOL material, Silver, Reference'] = USyearly['Waste_EOL_silver_Reference.Mod']/1e6
newdf['EOL material as fraction of demand, Silver, Reference'] = USyearly['Waste_EOL_silver_Reference.Mod']/USyearly['VirginStock_silver_Reference.Mod']
newdf['Virgin material demands, Aluminum, Reference'] = USyearly['VirginStock_aluminum_Reference.Mod']/1e6
newdf['EOL material, Aluminum, Reference'] = USyearly['Waste_EOL_aluminum_Reference.Mod']/1e6
newdf['EOL material as fraction of demand, Aluminum, Reference'] = USyearly['Waste_EOL_aluminum_Reference.Mod']/USyearly['VirginStock_aluminum_Reference.Mod']
newdf['Virgin material demands, Silicon, Grid Decarb.'] = USyearly['VirginStock_silicon_'+SFscenarios[1]]/1e6
newdf['EOL material, Silicon, Grid Decarb.'] = USyearly['Waste_EOL_silicon_'+SFscenarios[1]]/1e6
newdf['EOL material as fraction of demand, Silicon, Grid Decarb.'] = USyearly['Waste_EOL_silicon_'+SFscenarios[1]]/USyearly['VirginStock_silicon_'+SFscenarios[1]]
newdf['Virgin material demands, Silver, Grid Decarb.'] = USyearly['VirginStock_silver_'+SFscenarios[1]]/1e6
newdf['EOL material, Silver, Grid Decarb.'] = USyearly['Waste_EOL_silver_'+SFscenarios[1]]/1e6
newdf['EOL material as fraction of demand, Silver, Grid Decarb.'] = USyearly['Waste_EOL_silver_'+SFscenarios[1]]/USyearly['VirginStock_silver_'+SFscenarios[1]]
newdf['Virgin material demands, Aluminum, Grid Decarb.'] = USyearly['VirginStock_aluminum_'+SFscenarios[1]]/1e6
newdf['EOL material, Aluminum, Grid Decarb.'] = USyearly['Waste_EOL_aluminum_'+SFscenarios[1]]/1e6
newdf['EOL material as fraction of demand, Aluminum, Grid Decarb.'] = USyearly['Waste_EOL_aluminum_'+SFscenarios[1]]/USyearly['VirginStock_aluminum_'+SFscenarios[1]]
newdf['Virgin material demands, Silicon, High Elec.'] = USyearly['VirginStock_silicon_'+SFscenarios[2]]/1e6
newdf['EOL material, Silicon, High Elec.'] = USyearly['Waste_EOL_silicon_'+SFscenarios[2]]/1e6
newdf['EOL material as fraction of demand, Silicon, High Elec.'] = USyearly['Waste_EOL_silicon_'+SFscenarios[2]]/USyearly['VirginStock_silicon_'+SFscenarios[2]]
newdf['Virgin material demands, Silver, High Elec.'] = USyearly['VirginStock_silver_'+SFscenarios[2]]/1e6
newdf['EOL material, Silver, High Elec.'] = USyearly['Waste_EOL_silver_'+SFscenarios[2]]/1e6
newdf['EOL material as fraction of demand, Silver, High Elec.'] = USyearly['Waste_EOL_silver_'+SFscenarios[2]]/USyearly['VirginStock_silver_'+SFscenarios[2]]
newdf['Virgin material demands, Aluminum, High Elec.'] = USyearly['VirginStock_aluminum_'+SFscenarios[2]]/1e6
newdf['EOL material, Aluminum, High Elec.'] = USyearly['Waste_EOL_aluminum_'+SFscenarios[2]]/1e6
newdf['EOL material as fraction of demand, Aluminum, High Elec.'] = USyearly['Waste_EOL_aluminum_'+SFscenarios[2]]/USyearly['VirginStock_aluminum_'+SFscenarios[2]]
newdf.to_csv(title_Method+' Demand vs EOL Fraction NATION.csv')